package com.aurora.oa.mycenter.view;

import android.os.Bundle;
import android.support.annotation.Nullable;
import android.widget.CompoundButton;
import android.widget.ToggleButton;

import com.aurora.oa.R;
import com.aurora.oa.activity.BaseActivity;
import com.aurora.oa.utils.SharedPreferencesUtil;

import butterknife.Bind;
import butterknife.ButterKnife;

/**
 * Created by Administrator on 2017/5/5 0005.
 */
public class MessageSendSetting extends BaseActivity {
    @Bind(R.id.tb_is_message_notice)
    ToggleButton tbIsMessageNotice;

    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        initTitlebar(true, "消息推送", true);
        setMyContentView(R.layout.activity_message_send_setting);
        ButterKnife.bind(this);
        tbIsMessageNotice.setChecked(SharedPreferencesUtil.getBoolean(this,SharedPreferencesUtil.IS_MESSAGE_NOTICE,true));
        tbIsMessageNotice.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {

            @Override
            public void onCheckedChanged(CompoundButton arg0, boolean arg1) {
                SharedPreferencesUtil.saveBoolean(MessageSendSetting.this,SharedPreferencesUtil.IS_MESSAGE_NOTICE,arg1);
            }
        });
    }
}
